/**
 * Created by douxin on 24/09/2016.
 */

import React from 'react';
const storage = window.localStorage;

class MerchantProfileContainer extends React.Component {

    handleButtonClick() {
        storage.setItem('token', null);
        window.location.assign('/');
    }

    render() {
        return (
            <div className="container">
                <div className="merchant-profile">
                    <img src={this.props.merchant.logo} alt={this.props.merchant.name || '店铺 logo'} className="img-rounded merchant-profile-avatar" />
                    <p className="merchant-profile-title">{this.props.merchant.name || '微壹大屏'}</p>
                </div>
                <div className="merchant-logout-container col-sm-12 col-md-12 col-lg-12">
                    <button className="btn btn-lg btn-default btn-block" onClick={this.handleButtonClick.bind(this)}>退出</button>
                </div>
            </div>
        );
    }
}

MerchantProfileContainer.propTypes = {
    merchant: React.PropTypes.object
};

export default MerchantProfileContainer;